package com.autohammal.ui.frame.data;

public class TargetForComboxViewer extends AbstractViewer {

	public TargetForComboxViewer() {
	}

	public TargetForComboxViewer(TargetForComboxViewData originView) {
		super(originView);
	}

	public TargetForComboxViewer(TargetForComboxViewData originView,
			TargetForComboxViewData masterView) {
		setOriginView(originView);
		setMasterView(masterView);
	}

	public TargetForComboxViewData newViewData(String name, Object value,
			ViewState viewState) {
		TargetForComboxViewData viewData = new TargetForComboxViewData(name,
				value);
		viewData.setViewState(viewState);
		addView(viewData);
		return viewData;
	}

	public String getMasterViewValue() {
		ViewData viewData = getMasterView();
		if (viewData != null)
			return viewData.getData().toString();
		return null;
	}

	public String getOriginViewValue() {
		ViewData viewData = getOriginView();
		if (viewData != null)
			return viewData.getData().toString();
		return null;
	}

}
